import {PageContainer} from '@ant-design/pro-components';
import '@umijs/max';
import {Button, Card, Space} from 'antd';
import React from 'react';
import {useAccess} from '@@/exports';
import {Access} from '@@/plugin-access';
import {errorUsingGet} from "@/services/backend/indexController";

const Test: React.FC = () => {
    const access = useAccess();

    const test = async () => {
        await errorUsingGet()
    };

    return (
        <PageContainer>
            <Card>
                <Space>
                    <Button onClick={test}>测试</Button>
                </Space>

                <Access accessible={access.canAdmin}>
                    <h2
                        style={{
                            textAlign: 'center',
                            marginTop: 24,
                        }}
                    >
                        权限可见标签
                    </h2>
                </Access>
            </Card>
        </PageContainer>
    );
};
export default Test;
